package com.lzj.demo.design.factory;

import com.lzj.demo.design.factory.service.ICommodity;

import java.util.HashMap;
import java.util.Map;

public class Test {
    public static void main(String[] args) throws Exception {
        StoreFactory factory = new StoreFactory();
        //优惠券
        ICommodity couponService = factory.getCommodityService(1);
        couponService.sendCommodity("001","commodityId001","biz001",null);

        //实物商品
        ICommodity goodsService = factory.getCommodityService(2);
        Map<String,String> map = new HashMap<>();
        map.put("userName","Faker先生");
        map.put("mobile","17727556972");
        map.put("address","福建三明沙县");
        goodsService.sendCommodity("001","commodityId001","biz002",map);

        //爱奇艺兑换卡
        ICommodity cardService = factory.getCommodityService(3);
        cardService.sendCommodity("001","commodityId001","biz003",null);
    }
}
